<?php
switch ($model->status) {
    case 0:
        $status = 'N';
        break;
    case 1:
        $status = 'Y';
        break;
    default :
        $status = 'N';
}
?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'person-task-form',
	'enableAjaxValidation'=>false,
)); ?>
	<div class="row">
    <table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%; color:#EF712E;">
      <tr height="30" align="center">
        <td width="10%">主记录标识</td>
        <td width="5%">用户</td>
        <td width="10%">周期</td>
        <td width="20%">日期</td>
        <td width="5%">类型</td>
        <td width="20%">创建时间</td>
        <td width="20%">更新时间</td>
        <td>状态</td>
      </tr>
      <tr height="30" align="center">
        <td><?=$model->pdid?></td>
        <td><?=$model->personDate->user->username?></td>
        <td><?=$model->personDate->type?></td>
        <td><?=$model->personDate->time?></td>
        <td><?=$model->personDate->style?></td>
        <td><?=date('Y-m-d H:i:s',$model->personDate->dateline)?></td>
        <td><?=date('Y-m-d H:i:s',$model->personDate->updated)?></td>
        <td><?=$model->personDate->status?></td>
      </tr>
    </table>
    </div>
    <div style="height:30px;">&nbsp;</div>
    <div class="row" style="color:#915629;">
    <table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%;">
      <tr height="30" align="center">
        <td width="5%">标识</td>
        <td width="8%">主分类</td>
        <td width="8%">次分类</td>
        <td width="5%">部门</td>
        <td width="8%">主负责</td>
        <td width="8%">辅负责</td>
        <td width="5%">周期</td>
        <td width="5%">权重</td>
        <td width="5%">分组</td>
        <td width="5%">创建</td>
        <td width="5%">修改</td>
        <td width="13%">计划开始时间</td>
        <td width="13%">计划结束时间</td>
        <td>完成度</td>
      </tr>
      <tr height="30" align="center">
        <td><?=$model->tid?></td>
        <td><?=$model->task->tcode?></td>
        <td><?=$model->task->subcode?></td>
        <td><?=$model->task->office?></td>
        <td><?=$model->task->tco?></td>
        <td><?=$model->task->sco?></td>
        <td><?=$model->task->periodic?></td>
        <td><?=$model->task->urgency?></td>
        <td><?=$model->task->group?></td>
        <td><?=$model->task->created_by?></td>
        <td><?=$model->task->updated_by?></td>
        <td><?=$model->task->estart?date('Y-m-d',$model->task->estart):'None'?></td>
        <td><?=$model->task->eend?date('Y-m-d',$model->task->eend):'None'?></td>
        <td><?=$model->task->complete?></td>
      </tr>
    </table>
    <table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%;">
      <tr height="30" align="center">
        <td>任务名称</td>
        <td width="13%">实际开始时间</td>
        <td width="13%">实际结束时间</td>
        <td width="8%">跟进人</td>
        <td width="5%">状态</td>
        <td width="20%">记录创建时间</td>
        <td width="20%">记录更新时间</td>
      </tr>
      <tr height="30" align="center">
        <td><?=$model->task->task?></td>
        <td><?=$model->task->rstart?date('Y-m-d',$model->task->rstart):'None'?></td>
        <td><?=$model->task->rend?date('Y-m-d',$model->task->rend):'None'?></td>
        <td><?=$model->task->follow_up_person?></td>
        <td><?=$model->task->status?></td>
        <td><?=date('Y-m-d H:i:s',$model->task->create_time)?></td>
        <td><?=date('Y-m-d H:i:s',$model->task->update_time)?></td>
      </tr>
    </table>
    <table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%;">
      <tr height="30" align="center">
        <td width="10%">任务详细</td>
        <td><?=$model->task->taskdetail?></td>
      </tr>
      <tr height="30" align="center">
        <td>备注</td>
        <td><?=$model->task->remark?></td>
      </tr>
    </table>
    </div>
    <div style="height:30px;">&nbsp;</div>
    <div class="row" style="color:#155F8F;">
    <?php
    if($model->status){
	?>
	<table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%;">
      <tr height="30" align="center">
        <td width="10%">完成度</td>
        <td width="40%"><?=$model->today_extra?></td>
        <td width="10%">花费时间</td>
        <td><?=$model->time_spent?></td>
      </tr>
      <tr height="30" align="center">
        <td width="10%">创建时间</td>
        <td width="40%"><?=date('Y-m-d H:i:s',$model->dateline)?></td>
        <td width="10%">更新时间</td>
        <td><?=date('Y-m-d H:i:s',$model->updated)?></td>
      </tr>
      <tr height="30" align="center">
        <td>操作者</td>
        <td><?=$model->user->username?></td>
        <td colspan="2">&nbsp;</td>
      </tr>
    </table>
    <?php
	}else{
	?>
    <table align="center" border="1" bordercolor="#004C6F" cellpadding="0" cellspacing="0" style="width:96%; margin-left:2%;">
      <tr height="30" align="center">
        <td width="10%">完成度</td>
        <td width="40%"><?php echo $form->textField($model,'today_extra'); ?></td>
        <td width="10%">花费时间</td>
        <td><?php echo $form->textField($model,'time_spent'); ?></td>
      </tr>
      <tr height="30" align="center">
        <td>状态</td>
        <td><?php echo $form->dropDownList($model,'status',array(0=>'N',1=>'Y',)); ?></td>
        <td>操作者</td>
        <td><?php echo $form->dropDownList($model,'transactor',$users); ?></td>
      </tr>
      <tr>
        <td colspan="4" align="center"><?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?></td>
      </tr>
    </table>
    <?php
	}
	?>
    </div>
    <div class="row" style="color:#9C2F2F; font-size:18px; font-weight:bold;" align="center">
		<?=$msg?>
    </div>
    
<?php $this->endWidget(); ?>
<?php
if($type){
?>
	<div style="width:100%; text-align:center"><a href="###" onclick="javascript:history.go(-1);">返回</a></div>
<?php
}
?>

</div><!-- form -->